1. Field of the Invention
The invention relates generally to computer generated three-dimensional images, and in particular to a method and an apparatus for producing a three-dimensional image from a two-dimensional image.
2. Description of Related Art
As used herein, the term image generally refers to two-dimensional arrangements of objects from any desired sources and of any desired content, that is in particular photographic or synthetic images and also two-dimensional areas, which represent distributions of measured values or other variables. Also, herein two-dimensional images contain objects defined by polygons (outline edges) and by patterns, color and/or shading of the areas. The objects may partially overlap such that the objects are only partly visible to the viewer.
Computer-based methods for converting a two-dimensional image to a three-dimensional image are known. For example, such a method is used in image processing systems.
The general problem is to create a solid-looking simulation of the third dimension, that is the direction of the axis perpendicular to the two-dimensional image plane, referred to as the z-direction or depth, from the viewer""s perspective. Typically, an edge extrusion method is used to produce a three-dimensional image from a two-dimensional image. In this method, the individual polygon edges of the two-dimensional objects are extended, that is, are shifted parallel such that the polygon edges are widened by a certain amount. This method works without any problem in the case of objects, which are represented apart from one another in the two-dimensional image, i.e., do not overlap or enclose one another.
If, however, the two-dimensional image contains objects, which do overlap one another and so partly obscure one another because of their arrangement and their varying distances with respect to the viewer, the known methods have the problem that the two-dimensional objects are assigned the same depth in the three-dimensional representation. This results in depth representations, which do not coincide with the visual impression of the depth arrangement of the objects from the two-dimensional image. Hence, a better method is needed to generating a three-dimensional image from a two-dimensional image.
According to the principles of this invention, a method for producing a three-dimensional representation from a two-dimensional image allows a better representation of the spatial depth of objects than the prior art methods. A two-dimensional image contains a number of objects, which are represented in layers from front to rear, perpendicularly with respect to the two-dimensional image plane. Each object is defined by a polygon, which encloses a distinguishably represented area of the two-dimensional image.
The method of this invention orders polygons in a plurality of polygons of a two-dimensional image in a sequence defined by layering of the polygons in the two-dimensional image. A first polygon in the sequence is a reference polygon.
The method sequentially assigns each polygon in the sequence, starting with the reference polygon, to one of a plurality of layers so that within a given layer no polygon assigned to the given layer (i) overlaps with another polygon in the given layer, and (ii) is included within another polygon in the given layer. After the assignment to the layer, the method extrudes the polygons of each layer to form a three-dimensional representation having a maximum depth in a direction out of a plane of the two-dimensional image, with each polygon in a reference layer having a minimum depth and polygons in layers other than the reference layer having a depth greater than the minimum depth and less than or equal to the maximum depth.
The method according to the invention is associated with a series of advantages: the ordering of the polygons in layers according to their depth, that is the taking over of the depth information implicitly present in the two-dimensional image, with a polygon handled later being assigned to the layer of the polygon previously considered if there is no overlap but assigned to a new layer if there is an overlap with the polygon previously considered, or inclusion, has the effect of producing a better impression of the depth in the three-dimensional representation while at the same time minimizing the layers required. This creates advantages with regard to the running time for the method, since the complexity of the method merely increases linearly with the number of objects. Moreover, a representation with a natural look is achieved. The provision of values for the minimum depth and the maximum depth of the three-dimensional image serves to ensure a good visual impression for the viewer.
In one embodiment, the invention includes a system having a processor and a memory storing a method for producing a three-dimensional image from a two-dimensional image including objects represented by a plurality of polygons, wherein upon execution of the method on the processor, the method comprises:
ordering polygons in the plurality of polygons in a sequence defined by layering of the polygons in the two-dimensional image wherein a first polygon in the sequence is a reference polygon;
sequentially assigning each polygon in the sequence, starting with the reference polygon, to one of a plurality of layers so that within a given layer no polygon assigned to the given layer (i) overlaps with another polygon in the given layer, and (ii) is included within another polygon in the given layer; and
extruding the polygons of each layer to form a three-dimensional representation having a maximum depth out of a plane of the two-dimensional image with each polygon in a reference layer having a minimum depth and polygons in layers other than the reference layer having a depth greater than the minimum depth and less than or equal to the maximum depth.
The system can be, for example, a client-server system, or alternatively, the processor and the memory are in a first device, and a display unit is a part of a second device where the second device is different from the first device, and further the display unit displays the three-dimensional representation.
According to the principles of this invention, a memory having a method for producing a three-dimensional image from a two-dimensional image including objects represented by a plurality of polygons stored therein, wherein upon execution of the method, the method comprises:
ordering polygons in the plurality of polygons in a sequence defined by layering of the polygons in the two-dimensional image wherein a first polygon in the sequence is a reference polygon;
sequentially assigning each polygon in the sequence, starting with the reference polygon, to one of a plurality of layers so that within a given layer no polygon assigned to the given layer (i) overlaps with another polygon in the given layer, and (ii) is included within another polygon in the given layer; and
extruding the polygons of each layer to form a three-dimensional representation having a maximum depth out of a plane of the two-dimensional image with each polygon in a reference layer having a minimum depth and polygons in layers other than the reference layer having a depth greater than the minimum depth and less than or equal to the maximum depth
In one embodiment, the method is, transferred from the memory to another memory. In one case, this transfer is a download over a communications network.
In still another embodiment, a computer system includes:
means for ordering polygons in the plurality of polygons in a sequence defined by layering of the polygons in the two-dimensional image wherein a first polygon in the sequence is a reference polygon;
means for sequentially assigning each polygon in the sequence, starting with the reference polygon, to one of a plurality of layers so that within a given layer no polygon assigned to the given layer (i) overlaps with another polygon in the given layer, and (ii) is included within another polygon in the given layer; and
means for extruding the polygons of each layer to form a three-dimensional representation having a maximum depth out of a plane of the two-dimensional image with each polygon in a reference layer having a minimum depth and polygons in layers other than-the reference layer having a depth greater than the minimum depth and less than or equal to the maximum depth.